cmake_minimum_required (VERSION 3.5)
project (demo)

message(STATUS "wqy.....RK_PROJECT_PACKAGE_ROOTFS_DIR=${RK_PROJECT_PACKAGE_ROOTFS_DIR}")

include_directories (./include)
include_directories (./include/libwebsockets)
include_directories (./include/mqtt)
include_directories (./include/bluez)

message(STATUS wqy--CMAKE_CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR})

#find_library(MY_LIBRARY_PATH NAMES websockets ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH)
message(STATUS wqy--MY_LIBRARY_PATH=${MY_LIBRARY_PATH})

#一种添加源码的方式
aux_source_directory(src SRC_FILES)

#依次添加源码的方式
#set(SRC_FILES src/main.c src/func1.c src/func2.c)

add_compile_options(-Wall -g)

add_executable(test_app ${SRC_FILES})
#add_executable(test_app main.c func1.c func2.c)

target_link_directories(test_app PRIVATE  ${CMAKE_CURRENT_SOURCE_DIR}/lib)

target_link_libraries(test_app websockets asound aiot bluetooth-internal shared-mainloop shared-glib rkwifibt wpa_client rockit auth_rv1106 base duiPlus MQBus sspe vad duiplusex pthread)

install(FILES lib/libwebsockets.so DESTINATION lib)
install(FILES lib/libwebsockets.so.19 DESTINATION lib)
install(FILES lib/libaiot.so DESTINATION lib)
install(FILES lib/librkwifibt.so DESTINATION lib)
install(FILES lib/libwpa_client.so DESTINATION lib)

# sibichi
install(FILES lib/libauth_rv1106.so DESTINATION lib)
install(FILES lib/libbase.so DESTINATION lib)
install(FILES lib/libduiPlus.so DESTINATION lib)
install(FILES lib/libMQBus.so DESTINATION lib)
install(FILES lib/libsspe.so DESTINATION lib)
install(FILES lib/libvad.so DESTINATION lib)

set (EXECUTABLE_OUTPUT_PATH ${CMAKE_INSTALL_PREFIX}/bin)
